<template>
  <el-menu ref="elMenuCom">
    <menu-temp v-for="item in props.menus" :key="item.menuId" :item="item" v-bind="useAttrs()" />
  </el-menu>
</template>

<script setup>
import { useAttrs } from 'vue'
import MenuTemp from './MenuTemp.vue'
const elMenuCom = ref()
const props = defineProps({
  menus: {
    type: Array,
    default: () => [],
  },
})

const setActive = (index) => {
  elMenuCom.value.updateActiveIndex(index)
}

defineExpose({ setActive })
</script>

<style lang="scss">
.el-menu {
  &--vertical {
    border: none;
  }
}
</style>
